﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Themes/Shared/Seller.master" Inherits="System.Web.Mvc.ViewPage<PagedList<GoodsOrders>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="CssContent" runat="server">
    <link type="text/css" rel="Stylesheet" href="/Style/Store.css" />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="JsContent" runat="server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="MainContent" runat="server">
    <div class="tdlist">
        <table border="0" cellpadding="0" cellspacing="0" width="100%">
            <tr>
                <th>
                    编号
                </th>
                <th>
                    订单详情
                </th>
                <th>
                    订单金额
                </th>
                <th>
                    订单状态
                </th>
                <th>
                    下单时间
                </th>
                <th>
                    收货人
                </th>
                <th>
                    收货人电话
                </th>
            </tr>
            <%if (null != Model)
              {
                  foreach (GoodsOrders data in Model)
                  {
                      IList<GoodsOrdersItem> items = data.GetGoodsOrdersItem();
                      decimal totalPrice = 0M;
            %>
            <tr>
                <td>
                    <%=data.Code%>
                </td>
                <td>
                    <%
                      if (null == items || items.Count <= 0)
                      { Writer.Write("&nbsp;"); }
                      else
                      {%><table border="0" cellpadding="0" cellspacing="0" width="100%">
                          <tr>
                              <th>商品名</th>
                              <th>属性</th>
                              <th>数量</th>
                              <th>单价</th>
                          </tr>
                          <%
                      foreach (GoodsOrdersItem item in items)
                      {
                          totalPrice += item.Amount * item.Price;
                          %>
                          <tr>
                              <td>
                                  <%=item.GetGood().Title.WriterString("&nbsp;").Substr(10) %>
                              </td>
                              <td>
                                  <%item.SKUProps.ForEach(p => { Writer.Write(p.GetGoodsSKUProp()); });%>
                              </td>
                              <td>
                                  <%=item.Amount %>
                              </td>
                              <td>
                                  <%=item.Price %>
                              </td>
                          </tr>
                          <%} %>
                      </table>
                    <% }%>
                </td>
                <td>
                    <%=totalPrice %>
                </td>
                <td>
                    <%
                      switch (data.OrdersState)
                      {
                          case 0:
                              Writer.Write("正常提交");
                              break;
                          case 1:
                              Writer.Write("申请撤销");
                              break;
                          case 2:
                              Writer.Write("已撤销");
                              break;
                          case 3:
                              Writer.Write("已完成");
                              break;
                          default:
                              Writer.Write("&nbsp;");
                              break;
                      }
                    %>
                </td>
                <td>
                    <%=data.PubTime %>
                </td>
                <td>
                    <%=data.ReceiptName.WriterString("&nbsp;")%>
                </td>
                <td>
                    <%=data.ReceiptTel.WriterString("&nbsp;")%>
                </td>
            </tr>
            <%}
              } %>
        </table>
    </div>
    <div class="pager" style="clear: both; padding-top: 10px">
        <%= Html.Pager("OrderList","Seller",Model.PageIndex, Model.PageSize, Model.TotalCount)%>
    </div>
</asp:Content>
